<?php include (dirname(__FILE__)."/../include/header.php"); ?>
<?php if(!isset($_SESSION['_shop'])){header("location:../user_login.php");}?>
<div class="container">
  <ul class="breadcrumb">
    <li> 店铺名称 <span class="divider">/</span> </li>
    <li><a href="<?php echo SITE_ROOT;?>/shop/edit_password.php">修改密码</a></li>
  </ul>
  <div class="row">
    <div class="span12 wash-paper user-center profile">
      <div class="row">
        <div class="span3">
          <?php include (dirname(__FILE__)."/../include/shop/left.php"); ?>
          <div class="span9">
            <div class="main-content">
              <div class="content-header">
                <h3>餐品明细管理</h3>
              </div>            
              <div class="span9 master-side restaurant-content">
              <div class="restaurant-tab-content" style="width:678px;">
                <div class="menu-category-filter">
                  <ul>
                    <li rel="all" class="active" >所有美食</li>
                    <?php   
					$sql1 = "select * from zy_category where shop_id=".$_SESSION['_shop']['shop_id'];
					$rs = mysql_query($sql1);
					while ($cat = mysql_fetch_array($rs)) {?>
                    <li rel="<?php echo $cat['cat_id'];?>" ><?php echo $cat['cat_name'];?></li>
                    <?php } ?>
                  </ul>
                </div>                   
              <div class="content-inner">
			  <div>
                <table class="favor_table table table-striped">
                  <thead>
                    <tr>
                      <th>美食</th>
                      <th>所属分类</th>
					  <th>菜品排序</th>
                      <th>单价</th>
                      <th>修改</th>
                      <th width="60">删除</th>
                    </tr>
                  </thead>
                  <tbody>
                    <?php
				  	$sql=mysql_query("SELECT zy_food.*,zy_category.* FROM zy_food,zy_category WHERE zy_category.cat_id = zy_food.cat_id AND zy_food.shop_id='".$_SESSION['_shop']['shop_id']."' order by food_id desc");
					while($food=mysql_fetch_array($sql)){
				  ?>
                    <tr class="favor_food food-category" id="food-category-<?php echo $food['cat_id'];?>">
                      <td><?php echo $food['food_name'];?></td>
                      <td><?php echo $food['cat_name'];?></td>
						<td><?php $sql2="select * from zy_food where food_name ='".$food['food_name']."'";
						$result2=mysql_query($sql2);
						$zy_food=mysql_fetch_array($result2);
						echo $zy_food['sort'];?></td>
                      <td><?php echo $food['price'];?></td>
                      <td><span class="admin_del" foodId="<?php echo $food['food_id'];?>"> 
					  <a href="food_edit.php?id=<?php echo $food['food_id'];?>">修改</a> </span></td>
                      <td><span class="admin_del" foodId="<?php echo $food['food_id'];?>">
					  <a href="food_delete.php?id=<?php echo $food['food_id'];?>">删除</a></span></td>
                    </tr>
                    <?php }?>
                  </tbody>
                </table>
              </div>
              <!--end contentarea-->
            </div>
            <!--end marin-content-->
          </div>
        </div>
        <div style="clear:both;"></div>
      </div>
    </div>
  </div>
  <a id="back-to-top" href="javascript:void(0);">
  <div class="backtotop"></div>
  </a> </div>
<?php include (dirname(__FILE__)."/../include/footer.php"); ?>